package com.tbit.uqbike.client.service.impl;

import com.tbit.uqbike.client.dao.core.MemberFeeDao;
import com.tbit.uqbike.client.pojo.MemberFee;
import com.tbit.uqbike.client.service.MemberFeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 免押会员费用
 *
 * @author Leon
 * 2019年9月23日 下午7:26:58
 */
@Service
public class MemberFeeServiceImpl implements MemberFeeService {
    @Autowired
    private MemberFeeDao memberFeeDao;

    public List<MemberFee> findByAccountId(Integer accountId) {
        return memberFeeDao.find(accountId);
    }

    @Override
    public List<MemberFee> find(Integer accountId) {
        return memberFeeDao.find(accountId);
    }

    @Override
    public List<MemberFee> query(Integer accountId, Integer pageNO, Integer rowCount) {
        Map<String, Object> map = new HashMap<>();
        map.put("accountId", accountId);
        map.put("page", (pageNO - 1) * rowCount);
        map.put("rowCount", rowCount);
        return memberFeeDao.query(map);
    }

    @Override
    public Integer count(Integer accountId) {
        Map<String, Object> map = new HashMap<>();
        map.put("accountId", accountId);
        return memberFeeDao.count(map);
    }

    @Override
    public MemberFee findById(Integer memberFeeId) {
        return memberFeeDao.findById(memberFeeId);
    }

}
